local voca = {}

for line in io.lines(arg[2]) do
	voca[line] = 1
end

local f = io.open(arg[3], 'w')

for line in io.lines(arg[1]) do
	local word
	for w in line:gmatch("[^ \t]+") do 
		word = w
		break
	end

	if voca[word] == 1 then 
		f:write(line .. "\n")
	end
end
f:close()
